import React,{Component} from 'react'
import { Layout } from 'antd';
import {BrowserRouter as Router, Switch, Redirect, Route} from 'react-router-dom'
import { render } from 'react-dom';
import LeftNav from '../component/left-nav'
import Header from '../component/header'
import 'antd/dist/antd.css'
import Home from '../Home/Home'
import Type from '../Type/Type'
import Recommend from '../Recommend/Recommend'
import Poem from '../Poem/Poem'
import Author from '../Author/Author'
import Users from '../Users/Users'
import Role from '../Role/Role'
import Chain from '../Games/Chain'
import Fly from '../Games/Fly'
import Word from '../Games/Word'

const { Footer, Sider, Content } = Layout;

export default class Admin extends Component{
  render(){
    return (
      <Layout style={{minHeight:'100vh'}}>
        <Sider>
          <LeftNav />
        </Sider>
        <Layout style={{background:'white'}}>
          <Header />
          <Content 
            className="site-layout-background"
            style={{
              margin: '24px 16px',
              padding: 24,
              minHeight: 280,
              background:'#f0f2f5'
            }}>
           
            <Switch>
              <Route path='/home'component={(props)=><Home {...props} />}/>
              <Route path='/type'component={(props)=><Type {...props} />}/>
              <Route path='/recommend'component={(props)=><Recommend {...props} />}/>
              <Route path='/poem'component={(props)=><Poem {...props} />}/>
              <Route path='/author'component={(props)=><Author {...props} />}/>
              {/* <Route path='/games'component={(props)=><Games {...props} />}/> */}
              <Route path='/games/chain'component={(props)=><Chain {...props} />}/>
              <Route path='/games/fly'component={(props)=><Fly {...props} />}/>
              <Route path='/games/word'component={(props)=><Word {...props} />}/>
              <Route path='/user'component={(props)=><Users {...props} />}/>
              <Route path='/role'component={(props)=><Role {...props} />}/>
              <Redirect to='/home'/>
            </Switch>
            
          </Content>
          <Footer style={{textAlign:'center',color:'rgba(0,0,0,0.5'}}>
              欢迎进入独白后台管理系统
          </Footer>
        </Layout>
      </Layout>
    )
  }
}

